/**
 * 菜品相关API
 */

const request = require('../utils/request');

/**
 * 获取分类下的菜品列表
 * @param {number} categoryId - 分类ID
 * @returns {Promise} 菜品列表数据
 */
const getDishList = (categoryId) => {
  return request.get('/user/dish/list', { categoryId });
};

/**
 * 根据菜品id查询菜品详情
 * @param {number} id - 菜品ID
 * @returns {Promise} 菜品详情数据
 */
const getDishById = (id) => {
  return request.get(`/user/dish/${id}`);
};

module.exports = {
  getDishList,
  getDishById
};